package com.spzx.user.api;

import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.user.api.domain.UserAddress;
import com.spzx.user.api.domain.UserInfo;
import com.spzx.user.api.factory.RemoteUserInfoServiceFallbackFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "remoteUserInfoService" ,
        value = ServiceNameConstants.USER_SERVICE ,
        fallbackFactory = RemoteUserInfoServiceFallbackFactory.class)
public interface RemoteUserInfoService {



    @PostMapping("/userInfo/register")
    public R<Boolean> register(@RequestBody UserInfo userInfo);


    @Operation(summary = "会员注册内部接口")
    @PostMapping("/userInfo/login")
    public R<UserInfo> login(@RequestParam("username") String username ,
                             @RequestParam("password")  String password);



    @Operation(summary = "内部调用接口：查询用户地址详情信息")
    @GetMapping("userInfo/{id}/")
    public R<UserAddress> getInfo(@PathVariable("id") Long id);
}


